home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / business / jivepost.zip / JIVE.SRC < prev    next >
Text File  |  1996-04-13  |  16KB  |  531 lines

  1. # ┌──────────────────────────────────────────────────────────────────────────┐
  2. # │          JIVE.SRC   (Chuckle Box Jive Posts)                             │
  3. # │                                                                          │
  4. # │          Version:   1.0  (Released 13 Apr 1996) for SBBS 2.20 - Rev B    │
  5. # │           Author:   Robert Nykvist  aka  Chuckles@LAUGHBOX               │
  6. # │                                                                          │
  7. # │          Warning:   This script is intended for SBBS systems running     │
  8. # │                     SBBS 2.20 or higher.  It ALTERS Flags, message       │
  9. # │                     area set, message reading functions (header), and    │
  10. # │                     imports files into SMB, and creates files.  Please   │
  11. # │                     Read the DOCS closely before running this Script.    │
  12. # │                                                                          │
  13. # └──────────────────────────────────────────────────────────────────────────┘
  14. !INCLUDE SBBSDEFS.INC
  15. !INCLUDE FILE_IO.INC
  16.  
  17.  
  18. # ┌───────────────────────────────────────────────────────────┐
  19. # │ Give User the $F1B Flag which is an Access requirement    │
  20. # │ to the JIVE smb if you have set it up properly.           │
  21. # └───────────────────────────────────────────────────────────┘
  22. compare_ars $F1B
  23.   if_false
  24.     toggle_user_flag 1 B
  25.   end_if
  26.  
  27.  
  28. # ┌───────────────────────────────────────────────────────────┐
  29. # │ Replacing some TEXT.DAT to customize reading of Messages. │
  30. # │ Note, these REVERT back to original when leaving script.  │
  31. # └───────────────────────────────────────────────────────────┘
  32. replace_text 1 ""
  33. replace_text 2 ""
  34. replace_text 3 ""
  35. replace_text 4 ""
  36. replace_text 5 ""
  37. replace_text 6 "\r\n\1n\1y\1\hJive by %%s\r\n\r\n"
  38. replace_text 7 ""
  39. replace_text 8 ""
  40. replace_text 9 "gh─────────────────────────────────────────────────────────────────────────────ng"
  41. # ┌────────────────────────────────────────────────────────────────┐
  42. # │ Portion of Read Message Prompt HIDDEN below using ^AZ (\1\26)  │
  43. # │ See your SBBS Manual on page 244 for Hidden Display Info.      │
  44. # │ Note, this REVERTs back to original when leaving script.       │
  45. # │   If $F1Z is being used, change the "\1\26" to flag not used.  │
  46. # │ Objective?  To keep reading clutter to a minimum.  KISS        │
  47. # │ (Keep it Simple Stupid).  I want them to see the message,      │
  48. # │ not the extra header and prompt data they don't need to know.  │
  49. # └────────────────────────────────────────────────────────────────┘
  50. replace_text 71 "\r\nhgPost \1\26[%%u] %%s [%%u] %%s \1\) w%%lung of hw%%lu   g?ng=Menu hw: "
  51. #                                  ^Begin Hide            ^End Hide
  52.  
  53. # ┌───────────────────────────────────────────┐
  54. # │ Top of Menu - Change Menu as you see fit. │
  55. # └───────────────────────────────────────────┘
  56. :top
  57. cls
  58. crlf
  59. crlf
  60. print "hìm────────w5▌   Chuckle Box Jive Posts   k▐nm──h──────\r\n"
  61. crlf
  62. print "òw▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄n▄\r\n"
  63. print "òh█2 Jive Post Jive Post Jive Pok0█\r\n"
  64. print "òw█2t Jive Post Jive Post Jive Pk0█\r\n"
  65. print "òw█2st Jk0█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀w█2ive k0█\r\n"
  66. print "òw█2ost k0█æw█2Jivek0█\r\n"
  67. print "òw█2Postk0█ä(yVk) wVngiewähw█2 Jivk0█\r\n"
  68. print "òw█2 Posk0█ä(yIk) wIngnfoähw█2t Jik0█\r\n"
  69. print "òw█2e Pok0█ä(yAk) wAngdd ähw█2st Jk0█\r\n"
  70. print "òw█2ve Pk0█ä(yQk) wQnguitähw█2ost k0█\r\n"
  71. print "òw█2ive k0█æw█2Postk0█\r\n"
  72. print "òw█2Jivek0█w▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█2 Posk0█\r\n"
  73. print "òw█2 Jive Post Jive Post Jive Pok0█\r\n"
  74. print "òw█2t Jive Post Jive Post Jive Pk0█\r\n"
  75. print "òn▀hk▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀\r\n"
  76. crlf
  77.  
  78.  
  79. # ┌────────────────────────────────────────────────────┐
  80. # │ Note Node Location & make sure things are in SYNC. │
  81. # │ before getting input.  ASYNC allows menu abort.    │
  82. # └────────────────────────────────────────────────────┘
  83. node_action node_xtrn
  84. sync
  85.  
  86.  
  87. # ┌──────────────────────────────────────────┐
  88. # │ Get User Input : View, Add, Info or Quit │
  89. # └──────────────────────────────────────────┘
  90. print "ÜmEnter y(wV,I,A,Qy) w> n"
  91. getcmd AIQV?
  92.  
  93.  
  94. # ┌──────────────┐
  95. # │ Re-Send Menu │
  96. # └──────────────┘
  97. cmdkey ?
  98.   cmd_pop
  99.   goto top
  100. end_cmd
  101.  
  102.  
  103. # ┌──────────────────────────────────────────┐
  104. # │ User Wants to Add Jivepost - GOTO WRITE  │
  105. # └──────────────────────────────────────────┘
  106. cmdkey A
  107.   cmd_pop
  108.   goto write
  109. end_cmd
  110.  
  111.  
  112. # ┌───────────────────────────────────────┐
  113. # │ Display Instructions/Info             │
  114. # │ Give Credit where Credit is Due. Tnx  │
  115. # └───────────────────────────────────────┘
  116. cmdkey I
  117.   cls
  118.   crlf
  119.   crlf
  120.   print "ònhyChuckle Box Jive Posts w- rVer 1.0\r\n"
  121.   print "ònmFor SBBS 2.20  by hRobert Nykvist\r\n"
  122.   crlf
  123.   print "wView Jive Posts\r\n"
  124.   print "  r■  ngWhen viewing jiveposts, you return to the last post you read.\r\n"
  125.   print "  hr■  ncPress Enter to read the next message if there are any.\r\n"
  126.   print "  hr■  ngGo back and read old messages by entering smaller number.\r\n"
  127.   print "  hr■  ncPress Q to Quit.\r\n"
  128.   print "  hr■  ngPress ? for the Reading Mesages Menu.\r\n"
  129.   crlf
  130.   print "hwAdd a Jive Post\r\n"
  131.   print "  r■  ngEnter your text one line at a time, up to four lines.\r\n"
  132.   print "  hr■  ncYou will be prompted to convert your message.\r\n"
  133.   print "  hr■  ngYou can convert your message to Jive, Valleyspeak or Mix of both.\r\n"
  134.   print "  hr■  ncThe Jive Poster alters your message and then,\r\n"
  135.   print "ädisplays the converted text to see if you want to save it.\r\n"
  136.   print "  hr■  ngSave it or start all over.n\r\n"
  137.   crlf
  138.   pause
  139.   cmd_pop
  140.   goto top
  141. end_cmd
  142.  
  143.  
  144. # ┌─────────────┐
  145. # │ Quit Script │
  146. # └─────────────┘
  147. cmdkey Q
  148.   cmd_pop
  149.   goto byebye
  150. end_cmd
  151.  
  152.  
  153. # ┌────────────────────────────────────────────┐
  154. # │ User Chooses to View Jiveposts - GOTO VIEW │
  155. # └────────────────────────────────────────────┘
  156. cmdkey V
  157.   cmd_pop
  158.   goto view
  159. end_cmd
  160.  
  161. # ###################### End of Main Menu GETCMD Options ######################
  162. # Fall through just in case.
  163. cmd_pop
  164. goto top
  165.  
  166.  
  167. # ┌───────────────────────────────────┐
  168. # │ Display Jive                      │
  169. # │ Set present message area to JIVE  └───────────────┐
  170. # │ Restrict your message base setup for JIVE SMB so  │
  171. # │ Users will not be able to write posts normally.   │
  172. # │ Set Write Level to 100                            │
  173. # └───────────────────────────────────────────────────┘
  174. :View
  175.   setstr "jive"
  176.   msg_set_area
  177.   msg_read
  178.   cmd_pop
  179. goto top
  180.  
  181.  
  182. # ┌──────────────────────────────────────────┐
  183. # │ Add Jive  - Get message, then convert it │
  184. # └──────────────────────────────────────────┘
  185. :Write
  186. cls
  187. crlf
  188. crlf
  189.  
  190.  
  191. # ┌───────────────────────────────────────┐
  192. # │ Define Strings for each line of input │
  193. # │ Use GETSTR to get user input.         │
  194. # └───────────────────────────────────────┘
  195. str one two three four
  196. print "rhWrite message now. y (w4nc-Lines Maxhy) nm Press ENTER at end of each line! \r\n"
  197. crlf
  198. print "hy1-> "
  199. # Get user input for line one
  200. sync
  201. getstr one 75 K_LINE|K_NOEXASC
  202.  
  203.  
  204. # ┌─────────────────────────────────────────────────────────────┐
  205. # │ If input is NULL on first line, quit by going back to TOP.  │
  206. # └─────────────────────────────────────────────────────────────┘
  207. compare one ""
  208.   if_true
  209.     cmd_pop
  210.     goto top
  211.   end_if
  212.  
  213.  
  214. print "hy2-> "
  215. # Get user input for line two
  216. sync
  217. getstr two 75 K_LINE|K_NOEXASC
  218. # ┌────────────────────────────────────────────────────────────────┐
  219. # │ If input is NULL on any other line, it is assumed user is done │
  220. # │ entering his/her message, and it is time to convert it.        │
  221. # └────────────────────────────────────────────────────────────────┘
  222. compare two ""
  223.   if_true
  224.     cmd_pop
  225.     goto convert
  226.   end_if
  227.  
  228. print "hy3-> "
  229. # Get user input for line three - same procedure as input for first line.
  230. sync
  231. getstr three 75 K_LINE|K_NOEXASC
  232. compare three ""
  233.   if_true
  234.     cmd_pop
  235.     goto convert
  236.   end_if
  237.  
  238. print "hy4-> "
  239. # Get user input for line four - same procedure as input for first line.
  240. sync
  241. getstr four 75 K_LINE|K_NOEXASC
  242. compare four ""
  243.   if_true
  244.     cmd_pop
  245.     goto convert
  246.   end_if
  247.  
  248.  
  249. :convert
  250. # ┌─────────────────────────────────┐
  251. # │ Define File Variable.           │
  252. # │ If file not present, create it. │
  253. # │ If file present, truncate data. │
  254. # └─────────────────────────────────┘
  255.   int userinput
  256.   fopen userinput O_CREAT|O_TRUNC|O_WRONLY|O_APPEND "c:\sbbs\jive\jivepost.dat"
  257.  
  258.  
  259. # ┌───────────────────────────────────────────────┐
  260. # │ Print variable ONE (first line input) to File │
  261. # │ Adding Line feeds & Returns. (\r\n)           │
  262. # └───────────────────────────────────────────────┘
  263.   fprintf userinput "%s\r\n" one
  264.  
  265.  
  266. # ┌───────────────────────────────────────────────────┐
  267. # │ If Variable two, or remaining variables are null, │
  268. # │ close file and let us begin conversion (DOIT).    │
  269. # └───────────────────────────────────────────────────┘
  270.   compare two ""
  271.     if_true
  272.       fclose userinput
  273.       cmd_pop
  274.       goto doit
  275.     end_if
  276.   fprintf userinput "%s\r\n" two
  277.   compare three ""
  278.     if_true
  279.       fclose userinput
  280.       cmd_pop
  281.       goto doit
  282.     end_if
  283.   fprintf userinput "%s\r\n" three
  284.   compare four ""
  285.     if_true
  286.       fclose userinput
  287.       cmd_pop
  288.       goto doit
  289.     end_if
  290.   fprintf userinput "%s\r\n" four
  291.  
  292. # ┌─────────────┐
  293. # │ Close'em Up │
  294. # └─────────────┘
  295. fclose userinput
  296.  
  297.  
  298. # ┌───────────────────────────────────────────────────┐
  299. # │ Option to User on how to convert his/her message, │
  300. # │ giving them a chance to abort (Quit).             │
  301. # └───────────────────────────────────────────────────┘
  302. :doit
  303. print "\r\nngConvert to whJngive, whVngalleyspeak, whMngix "
  304. print "or whQnguit?h y (wJVMQy)w > n"
  305. sync
  306. getcmd JMQV
  307.  
  308.  
  309. # ┌─────────────────┐
  310. # │ Convert to JIVE │
  311. # └─────────────────┘
  312. cmdkey J
  313.   crlf
  314.   print "hwHo'd yo' hosses, bawse!  I'se a-changin' yo honky-type to Jive!"
  315.   crlf
  316. # ┌───────────┐
  317. # │ ALERT!!!  └─────┐
  318. # │ Below Path OK?  └───────┐
  319. # │ Paths in LAWDIE.BAT Ok? │
  320. # └─────────────────────────┘
  321.   exec "command /c c:\sbbs\jive\lawdie"
  322.   crlf
  323.   print "hy.,.,.,.,.,.,.,.,.,.  mDONE!\r\n"
  324.   pause
  325.   cmd_pop
  326.   goto altered
  327. end_cmd
  328.  
  329.  
  330. # ┌──────────────────────────────────────┐
  331. # │ Convert to MIX of JIVE & VALLEYSPEAK │
  332. # └──────────────────────────────────────┘
  333. cmdkey M
  334.   crlf
  335.   print "whGag me wid spoon!  I'se changin' your text to ValJive, fershure, bro'!"
  336.   crlf
  337. # ┌───────────┐
  338. # │ ALERT!!!  └─────┐
  339. # │ Below Path OK?  └────────┐
  340. # │ Paths in VALJIVE.BAT Ok? │
  341. # └──────────────────────────┘
  342.   exec "command /c c:\sbbs\jive\valjive"
  343.   crlf
  344.   print "hy.,.,.,.,.,.,.,.,.,.  mDONE!\r\n"
  345.   pause
  346.   cmd_pop
  347.   goto altered
  348. end_cmd
  349.  
  350.  
  351. # ┌────────────────────────┐
  352. # │ Convert to VALLEYSPEAK │
  353. # └────────────────────────┘
  354. cmdkey V
  355.   crlf
  356.   print "whLike, wait a minute, 'k? ' Cuz like, I'm changing your text to ValleySpeak!"
  357.   crlf
  358. # ┌───────────┐
  359. # │ ALERT!!!  └─────┐
  360. # │ Below Path OK?  └─────────┐
  361. # │ Paths in FERSHURE.BAT Ok? │
  362. # └───────────────────────────┘
  363.   exec "command /c c:\sbbs\jive\fershure"
  364.   crlf
  365.   print "hy.,.,.,.,.,.,.,.,.,.  mDONE!\r\n"
  366.   pause
  367.   cmd_pop
  368.   goto altered
  369. end_cmd
  370.  
  371.  
  372. # ┌─────────────────────────┐
  373. # │ Quit (Abort Conversion) │
  374. # └─────────────────────────┘
  375. cmdkey Q
  376.   cmd_pop
  377.   goto top
  378. end_cmd
  379.  
  380. # Fall Thru just in case...
  381. cmd_pop
  382. goto top
  383.  
  384.  
  385. # ┌─────────────────────────────────────────────┐
  386. # │ Time to show converted JIVEpost to user.    │
  387. # │ Posts don't always turn out like you want.  │
  388. # └─────────────────────────────────────────────┘
  389. :altered
  390. crlf
  391. print "gh─────────────────────────────────────────────────────────────────────────────ng"
  392. crlf
  393. # ┌───────────┐
  394. # │ ALERT!!!  │
  395. # │ Path OK?  └─────────────┐
  396. # └─────────────────────────┘
  397. printfile "c:\sbbs\jive\jivepost.jiv"
  398. crlf
  399. print "gh─────────────────────────────────────────────────────────────────────────────ng\r\n"
  400. print "\r\nrhIs this OK to post? y (wYn/hwNy) > n"
  401.  
  402.  
  403. # ┌────────────────────────────────────────────┐
  404. # │ Are they happy with the converted results? │
  405. # └────────────────────────────────────────────┘
  406. sync
  407. getcmd NY
  408.  
  409.  
  410. # ┌──────────────────────────────────────────────────┐
  411. # │ Don't like input?  Damn...go back to top of menu │
  412. # └──────────────────────────────────────────────────┘
  413. cmdkey N
  414.   cmd_pop
  415.   goto top
  416. end_cmd
  417.  
  418.  
  419.  
  420. # ┌──────────────────────────────────────┐
  421. # │ Mikey Likes It!  Let's Post the Jive │
  422. # └──────────────────────────────────────┘
  423. cmdkey Y
  424.  
  425.  
  426. # ┌───────────────────────────────────────────────────────┐
  427. # │ Defining and Adding a message Divider to the message. │
  428. # │ Strictly for visual balance when reading messages.    │
  429. # │ Probably could be done differently...but I'm tired!   │
  430. # └───────────────────────────────────────────────────────┘
  431. str divider
  432. set divider "gh─────────────────────────────────────────────────────────────────────────────"
  433.  
  434.  
  435. # ┌───────────┐
  436. # │ ALERT!!!  │
  437. # │ Path OK?  └─────────────────────────────────────────────────┐
  438. # │ Opening open up their converted message and adding divider. │
  439. # └─────────────────────────────────────────────────────────────┘
  440. int liner
  441. fopen liner O_WRONLY|O_APPEND "c:\sbbs\jive\jivepost.jiv"
  442.   fprintf liner "\r\n%s" divider
  443. fclose liner
  444.  
  445.  
  446. # ┌───────────────────────────────────────────────────────────────┐
  447. # │ Defining another file to be used for SMBUTIL user data input. │
  448. # │ This Script uses SMBUTIL i option - See Manual 2.20 page 193  │
  449. # └───────────────────────────────────────────────────────────────┘
  450.   int file
  451.   str towho subjeck
  452.  
  453.  
  454. # ┌───────────┐
  455. # │ ALERT!!!  │
  456. # │ Path OK?  └──────────────────────────────────────────┐
  457. # │ SMBUTIL uses this data file to import file into SMB. │
  458. # └──────────────────────────────────────────────────────┘
  459.   fopen file O_CREAT|O_TRUNC|O_WRONLY|O_APPEND "c:\sbbs\jive\jiveuser.dat"
  460.  
  461.  
  462. # ┌──────────────────────────────┐
  463. # │ Line 1: Jivepost TO: ALL     │
  464. # │ (Formality - Not really used.│
  465. # └──────────────────────────────┘
  466.   set towho "ALL\r\n"
  467.   fprintf file "%s" towho
  468.  
  469.  
  470. # ┌────────────────────────┐
  471. # │ Line 2: Jivepost FROM: │
  472. # └────────────────────────┘
  473.   fwrite file _useron.alias
  474.  
  475.  
  476. # ┌──────────────────────────────┐
  477. # │ Line 3: Jivepost SUBJECT:    │
  478. # │ (Formality - Not really used.│
  479. # └──────────────────────────────┘
  480.   set subjeck "\r\nJivePosts\r\n"
  481.   fprintf file "%s" subjeck
  482.  
  483.  
  484. # ┌─────────────┐
  485. # │ Close'em Up │
  486. # └─────────────┘
  487.   fclose file
  488.  
  489.  
  490. # ┌───────────┐
  491. # │ ALERT!!!  └─────┐
  492. # │ Below Path OK?  └────────┐
  493. # │ Paths in IMPORT.BAT Ok?  └────────────────────────┐
  494. # │ The Commandline in IMPORT.BAT is what imports the │
  495. # │ converted Jivepost.Jiv into the Jivepost SMB.     │
  496. # └───────────────────────────────────────────────────┘
  497.   exec "command /c c:\sbbs\jive\import"
  498.   cmd_pop
  499.   goto top
  500. end_cmd
  501.  
  502.  
  503. # Fall thru just in case...
  504. cmd_pop
  505. goto top
  506.  
  507.  
  508. # ┌─────────────┐
  509. # │ Exit Script └─────────────────────────────────────────┐
  510. # │ Turn Flag 1B back off which hides the JivePosts from  │
  511. # │ normal Message Reading Access.  The Jivepost message  │
  512. # │ base doesn't exist to the user unless in this Script. │
  513. # │              Like a hidden room eh?                   │
  514. # │ Revert everything back to the way it was for the user.│
  515. # └───────────────────────────────────────────────────────┘
  516. :byebye
  517. compare_ars $F1B
  518.   if_true
  519.    toggle_user_flag 1 B
  520.   end_if
  521. revert_text 1
  522. revert_text 2
  523. revert_text 3
  524. revert_text 4
  525. revert_text 5
  526. revert_text 6
  527. revert_text 7
  528. revert_text 8
  529. revert_text 9
  530. revert_text 71
  531.